﻿//表格鼠标悬停换色
function change_colorOver(e) {
    var oldColor = e.style.backgroundColor;
    document.getElementById("colorName").value = oldColor;
    e.style.backgroundColor = "#e1d1c1";
}
function change_colorOut(e) {
    e.style.backgroundColor = document.getElementById("colorName").value;
}

$(function () {
    $('#spanHelp').toggle(function () {
        $('#divHelp').slideDown('normal');
    }, function () {
        $('#divHelp').slideUp('normal');
    });
});

//初始化select标签
function InitSelect(strUrl, strName) {
    $.ajax({
        url: strUrl,
        type: 'post',
        data: '',
        dataType: 'json',
        success: function (r) {
            for (var i = 0; i < r.length; i++) {
                $('select[name=' + strName + ']').append("<option value='" + r[i].ID + "'>" + r[i].strName + "</option>");
            }
        }, error: function (r) {
            $.Zebra_Dialog('<strong>加载信息失败 ！</strong>');
        }
    });
}



function ShowFrm(wbid) {
    $('#divfrm').fadeIn("normal");
    $('#WBID').val(wbid);
    if (wbid == "0") {//新增网点
        ShowFrm_Add(wbid);
    }
    else { //编辑网点
        ShowFrm_Update(wbid);
    }
};

function CloseFrm() {
    $('#divfrm').fadeOut("normal");
};


